4 * @covers PageLangLogFormatter
6 class PageLangLogFormatterTest
extends LogFormatterTestCase
{
8 protected function setUp() {
11 // Disable cldr extension
12 $this->setMwGlobals( 'wgHooks', [] );
13 // Register LogHandler, see $wgPageLanguageUseDB in Setup.php
14 $this->mergeMwGlobalArrayValue( 'wgLogActionsHandlers', [
15 'pagelang/pagelang' => 'PageLangLogFormatter',
20 * Provide different rows from the logging table to test
21 * for backward compatibility.
22 * Do not change the existing data, just add a new database row
24 public static function providePageLangLogDatabaseRows() {
30 'action' => 'pagelang',
31 'comment' => 'page lang comment',
32 'namespace' => NS_MAIN
,
35 '4::oldlanguage' => 'en',
36 '5::newlanguage' => 'de[def]',
40 'text' => 'User changed the language of Page from English (en) to Deutsch (de) [default]',
42 'oldlanguage' => 'en',
43 'newlanguage' => 'de[def]'
51 * @dataProvider providePageLangLogDatabaseRows
53 public function testPageLangLogDatabaseRows( $row, $extra ) {
54 $this->doTestLogFormatter( $row, $extra );